package com.youxuan.controller;

import com.youxuan.pojo.entity.Place;
import com.youxuan.pojo.entity.ResponseResult;
import com.youxuan.service.PlaceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/place")
@Api(tags = "地点")
public class PlaceController {

    @Autowired
    private PlaceService placeService;

    @GetMapping("/list")
    @ApiOperation("获取地点列表")
    public ResponseResult getPlaceList() {
        List<Place> placeList = placeService.getPlaceList();
        return ResponseResult.okResult(placeList);
    }
}
